<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="path" value="${pageContext.request.contextPath}"/>
<%String path = request.getContextPath();%>
<html>
<head>
    <title>Title</title>
</head>
<body>
${requestScope.questionType.title}....
</body>
</html>
<script src="/static/js/jquery-3.5.1.min.js"></script>

<script>
    $(function(){

        $.getJSON("/manage/questionType/viewAjax",
            {id:${param.id}},
            function(result) {

                console.log(this);
            }
        );

        $.ajax({
            url:"/manage/questionType/textAjax",
            dataType:"json",
            success:function(result) {
                console.log(this);
            }
        });

        $.ajax({
            url:"/manage/questionType/viewAjax",
            data:{id:${param.id}},
            dataType:"json",
            success:function(result)
            {

                console.log(this);
               /* console.log(result.data.title);
                console.log(result);
                console.log(result.status);
                console.log(result.msg);
                console.log(result.data);*/
            }
        });
     /*   $.ajax({
            url:"/manage/questionType/viewAjax",
            data:{id:${param.id}},
            dataType:"json",
           success:function (questionType) {
                console.log("success..........");
                console.log(questionType==null);
                console.log(questionType==undefined);
                console.log(questionType=="");

                console.log(questionType);
                console.log(questionType.title);
            },
            error: function(xhr,statusText,e) {

                console.log(xhr.responseText==null);
                console.log(xhr.responseText==undefined);
                console.log(xhr.responseText=="");
                console.log(xhr.status);
                console.log(statusText);
                console.log(e);
            },
            complete:function(xhr,statusText) {
                var questionType = xhr.responseText;

                if(questionType!="")
                {
                    questionType = JSON.parse(questionType);
                    console.log(questionType.title);
                }
            }
        });*/
    });
</script>











